package com.itheima.a06demo1;

import java.math.BigInteger;

public class BigintegerDemo1 {
    public static void main(String[] args) {
        //创建对象
        BigInteger bd1=BigInteger.valueOf(10);
        BigInteger bd2=BigInteger.valueOf(15);

        //1 加法
        BigInteger bd3 = bd1.add(bd2);
        System.out.println(bd3);

        //2 商和余数
        BigInteger[] arr = bd1.divideAndRemainder(bd2);
        System.out.println(arr[0]);
        System.out.println(arr[1]);

        //3 比较两个数是否相同
        boolean result = bd1.equals(bd2);
        System.out.println(result);

        //4 次幂
        BigInteger bd4 = bd1.pow(2);
        System.out.println(bd4);

        //5 比较大小
        BigInteger bd5 = bd1.max(bd2);
        System.out.println(bd5);
    }
}
